import moment from 'moment';
export const searchProps = [
  {
    type: 'select_input_one',
    value: 'channelId',
    name: '渠道',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '180px',
    },
  },
  {
    type: 'select_input_tow',
    value: 'loanId',
    name: '产品名称',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '180px',
    },
  },
  {
    type: 'date3',
    value: 'time',
    name: '日期',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '240px',
    },
  },
];

export const columns = [
  {
    title: '序号',
    dataIndex: 'index',
    width: 70,
    customRender: (text, record, index) => `${index + 1}`,
  },
  {
    dataIndex: 'statisticsDate',
    title: '统计时间',
    ellipsis: true,
    width: 180,
    customRender: (text) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
  },
  
  // {
  //   dataIndex: 'backSucNum',
  //   title: '回调成功量',
  //   ellipsis: true,
  //   width: 150,
  //   customRender: (text) => (text === 0 ? 0 : text || '/'),
  // },
  // {
  //   dataIndex: 'channelId',
  //   title: '渠道ID',
  //   ellipsis: true,
  //   width: 180,
  //   customRender: (text) => text || '/',
  // },
  {
    dataIndex: 'channelName',
    title: '渠道名称',
    ellipsis: true,
    width: 180,
    customRender: (text) => text || '/',
  },
  // {
  //   dataIndex: 'loanId',
  //   title: '产品ID',
  //   ellipsis: true,
  //   width: 180,
  //   customRender: (text) => text || '/',
  // },
  {
    dataIndex: 'loanName',
    title: '产品名称',
    ellipsis: true,
    width: 240,
    customRender: (text) => text || '/',
  },
  {
    key: 'ipOnlyReqNum',
    title: '结算量',
    align: 'center',
    
    children: [
      {
        dataIndex: 'ipOnlyReqNum',
        title: 0,
        align: 'center',
        ellipsis: true,
        width: 180,
        customRender: (text) => (text === 0 ? 0 : text || '/'),
      },
    ],
  },
  {
    key: 'onlyReqNum',
    title: '唯一访问量',
    align: 'center',
    
    children: [
      {
        dataIndex: 'onlyReqNum',
        title: 0,
        align: 'center',
        ellipsis: true,
        width: 180,
        customRender: (text) => (text === 0 ? 0 : text || '/'),
      },
    ],
  },
  {
    key: 'collisionSucNum',
    title: '撞库成功数量',
    align: 'center',
    
    children: [
      {
        dataIndex: 'collisionSucNum',
        title: 0,
        align: 'center',
        ellipsis: true,
        width: 180,
        customRender: (text) => (text === 0 ? 0 : text || '/'),
      },
    ],
  },
  {
    key: 'pushNum',
    title: '推送量',
    align: 'center',
    
    children: [
      {
        dataIndex: 'pushNum',
        title: 0,
        align: 'center',
        ellipsis: true,
        width: 180,
        customRender: (text) => (text === 0 ? 0 : text || '/'),
      },
    ],
  },
  {
    key: 'pushSucNum',
    title: '推送成功量',
    align: 'center',
    
    children: [
      {
        dataIndex: 'pushSucNum',
        title: 0,
        align: 'center',
        ellipsis: true,
        width: 180,
        customRender: (text) => (text === 0 ? 0 : text || '/'),
      },
    ],
  },
];
console.log('打印的值',columns)